package org.conan.groupapp.framework.service;

import java.util.List;
import java.util.Map;

import org.conan.groupapp.framework.entity.PageData;
import org.conan.groupapp.framework.entity.ParamBean;

/**
 * 
 * @author Administrator
 *
 */
public interface IBaseService<T extends ParamBean> {
	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public T save(T t) throws Exception;
	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public T modify(T t) throws Exception;
	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public int remove(Integer pirmaryKey) throws Exception;
	
	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public T removeByCondition(T t) throws Exception;
	/**
	 * 
	 * @param t
	 * @param rowStart
	 * @param rowEnd
	 * @return
	 * @throws Exception
	 */
	public List<T> selectByCondition(T t,int rowStart, int rowEnd) throws Exception;
	
	/**
	 * 
	 * @param t
	 * @param rowStart
	 * @param rowEnd
	 * @return
	 * @throws Exception
	 */
	public List<Map> selectMapByCondition(T t, int rowStart, int rowEnd) throws Exception;
	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public int countByCondition(T t) throws Exception;
	
	/**
	 * 
	 * @param primaryKey
	 * @return
	 * @throws Exception
	 */
	public T selectByPrimaryKey(Integer primaryKey) throws Exception;
	
	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public PageData pageList(T t) throws Exception;
	
	/**
	 * 
	 * @param t
	 * @return
	 * @throws Exception
	 */
	public PageData pageMapList(T t) throws Exception;
	/**
	 * 
	 * @return
	 */
	public PageData convertPageList(PageData pd);
	/**
	 * 
	 * @param currentPage
	 * @param totalPage
	 * @param totalRecords
	 * @param list
	 * @return
	 */
	public String toPageJson(PageData pd);
}
